//
//  ServiceViewController.m
//  mendianjieke
//
//  Created by 响当当 on 7/30/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "ServiceViewController.h"
#import "ServiceView.h"

@interface ServiceViewController ()
@property (nonatomic, strong)ServiceView *serviceView;
@end

@implementation ServiceViewController

- (ServiceView *)serviceView
{
    if (!_serviceView)
    {
        _serviceView = [[ServiceView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT-TABBAR_HEIGHT)];
        WeakSelf(self)
        _serviceView.serviceLockBlock = ^{
            [weakSelf getInfo:@"1"];
        };
    }
    return _serviceView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setTitle:@"服务中"];

    [self.view addSubview:self.serviceView];
    
    [self getInfo:@"1"];

}


- (void)getInfo:(NSString *)type
{
    NSDictionary *pramaters = @{
                                @"type" : type
                                };
    
    WeakSelf(self)
    [infoManager getTimeInfo:pramaters sucess:^(id  _Nonnull acceptData) {
        [weakSelf.serviceView getInfo:acceptData];
    } fail:^(NSError * _Nullable error) {
        
    }];
}

@end
